package com.wicket.okrfinance.web.contorller;

import cn.hutool.core.bean.BeanUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.page.PageMethod;
import com.wicket.okrfinance.biz.service.TargetCalcService;
import com.wicket.okrfinance.biz.service.dto.req.*;
import com.wicket.okrfinance.biz.service.dto.res.*;
import com.wicket.okrfinance.common.ro.OkrResult;
import com.wicket.okrfinance.common.util.CommonFunctionHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/finance/targetCalc/")
public class TargetCalcController {

  @Autowired
  TargetCalcService targetCalcService;
/**
   * D7分析目标内容财务数据(公共)
   */
    @PostMapping("analysisTargetContFinanceDataCom")
    public OkrResult<AnalysisTargetContFinanceDataComRespDto> analysisTargetContFinanceDataCom(@RequestBody @Validated AnalysisTargetContFinanceDataComReqDto reqDTO){
    return OkrResult.success(targetCalcService.analysisTargetContFinanceDataCom(reqDTO));
    }

/**
   * D7查询当前及祖先财务账户列表(公共)
   */
    @PostMapping("queryCurAndAncestorFinaceListCom")
    public OkrResult<QueryCurAndAncestorFinaceListComRespDto> queryCurAndAncestorFinaceListCom(@RequestBody @Validated QueryCurAndAncestorFinaceListComReqDto reqDTO){
    return OkrResult.success(targetCalcService.queryCurAndAncestorFinaceListCom(reqDTO));
    }
/**
   * D7执行单张牌财务标准数据准备redis(公共)
   */
    @PostMapping("implementSingleFinaceStandardDataRedisCom")
    public OkrResult<ImplementSingleFinaceStandardDataRedisComRespDto> implementSingleFinaceStandardDataRedisCom(@RequestBody @Validated ImplementSingleFinaceStandardDataRedisComReqDto reqDTO){
    return OkrResult.success(targetCalcService.implementSingleFinaceStandardDataRedisCom(reqDTO));
    }
/**
   * D7执行当前内容及祖先财务和标准数据(公共)
   */
    @PostMapping("implementCurAndAncestorFinaceAndStandardCom")
    public OkrResult<ImplementCurAndAncestorFinaceAndStandardComRespDto> implementCurAndAncestorFinaceAndStandardCom(@RequestBody @Validated ImplementCurAndAncestorFinaceAndStandardComReqDto reqDTO){
    return OkrResult.success(targetCalcService.implementCurAndAncestorFinaceAndStandardCom(reqDTO));
    }
/**
   * D7新增业务配置方案数据(内存)
   */
    @PostMapping("addBusinessConfigSevenDataCom")
    public OkrResult<AddBusinessConfigSevenDataComRespDto> addBusinessConfigSevenDataCom(@RequestBody @Validated AddBusinessConfigSevenDataComReqDto reqDTO){
    return OkrResult.success(targetCalcService.addBusinessConfigSevenDataCom(reqDTO));
    }
/**
   * D7更新当前内容及祖先财务账户并推Redis(公共)
   */
    @PostMapping("refreshCurAndAncestorFinaceAccountAndPushRedisCom")
    public OkrResult<RefreshCurAndAncestorFinaceAccountAndPushRedisComRespDto> refreshCurAndAncestorFinaceAccountAndPushRedisCom(@RequestBody @Validated RefreshCurAndAncestorFinaceAccountAndPushRedisComReqDto reqDTO){
    return OkrResult.success(targetCalcService.refreshCurAndAncestorFinaceAccountAndPushRedisCom(reqDTO));
    }
}
